Skip to content

Add architecture docs and agent coding guidelines - #230

Open
nschimme wants to merge 6 commits into
masterfrom
docs-architecture-agent-guidelines-4212318795681793304
Open

Add architecture docs and agent coding guidelines#230
nschimme wants to merge 6 commits into
masterfrom
docs-architecture-agent-guidelines-4212318795681793304

Conversation

@nschimme

@nschimme nschimme commented May 19, 2026

Copy link
Copy Markdown
Owner

This change introduces a high-level architecture overview in docs/architecture.md to help developers and AI agents quickly understand the system's structure, particularly the proxy communication pipeline. It also updates AGENTS.md with a link to this documentation and adds a new "Coding Guidelines" section. These guidelines capture essential project-specific knowledge, such as the use of the Signal2 system, UTF-8 string encoding requirements, and atomic file saving patterns, ensuring better consistency and fewer bugs in future contributions.


PR created automatically by Jules for task 4212318795681793304 started by @nschimme

Summary by Sourcery

Add high-level architecture documentation and agent-facing coding guidelines to improve contributors’ understanding of the system and ensure consistent implementation practices.

Documentation:

  • Add a new architecture overview document describing the proxy data flow, key components, and core design patterns.
  • Extend AGENTS.md with a link to the architecture docs and project-specific coding guidelines for agents and contributors.

- Author docs/architecture.md providing a high-level overview of the
  proxy pipeline, core components, and design patterns.
- Update AGENTS.md to link to the new architecture doc.
- Add a "Coding Guidelines" section to AGENTS.md to document project-
  specific best practices and common pitfalls for future agents.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@sourcery-ai

sourcery-ai Bot commented May 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a high-level architecture overview document for MMapper, focused on the proxy data-flow pipeline and main subsystems, and extends AGENTS.md with links plus concrete coding guidelines for signals, string encoding, atomic file saving, memory management, and shortest-path performance.

Flow diagram for proxy pipeline data flow in MMapper architecture

flowchart LR
    subgraph UserSide[User side]
        UC["UserClient"] --> USocket["UserSocket"]
        USocket --> UTelnet["UserTelnet"]
        UTelnet --> ULineFilter["TelnetLineFilter"]
        ULineFilter --> UParser["AbstractParser"]
    end

    subgraph Proxy[Proxy]
        UParser --> MTelnet["MudTelnet"]
        MTelnet --> MSocket["MudSocket"]
        MSocket --> MTelnetBack["MudTelnet"]
        MTelnetBack --> MLineFilter["TelnetLineFilter"]
        MLineFilter --> MpiFilter["MpiFilter"]
        MpiFilter -->|remote edit| RemoteEdit["RemoteEdit"]
        MpiFilter -->|game data| MumeXmlParser["MumeXmlParser"]
        RemoteEdit --> UTelnetBack["UserTelnet"]
        MumeXmlParser --> UTelnetBack
    end

    subgraph MudSide[MUD side]
        MSocket --- MudServer["MudServer"]
    end

    UTelnetBack --> USocketBack["UserSocket"]
    USocketBack --> UCBack["UserClient"]
Loading

File-Level Changes

Change Details Files
Introduce an architecture overview document explaining the proxy pipeline, key subsystems, and core design patterns.
  • Document bidirectional data flow between user client and MUD server via Proxy and related components
  • Describe major subsystems: map/world state, rendering, observer pattern, and group management
  • Explain custom Signal2 system usage and lifetime management
  • Describe pipeline-style interfaces via nested Outputs structs to clarify component interactions
docs/architecture.md
Update AGENTS.md to point to the new architecture docs and define project-specific coding guidelines.
  • Add Architecture Documentation section linking to docs/architecture.md and recommending it as prerequisite reading
  • Add Coding Guidelines section detailing correct Signal2 usage versus Qt signals
  • Specify UTF-8-safe string conversion via mmqt::toStdStringUtf8 instead of QString::toStdString
  • Define atomic file save sequence using flush, fsync, close, and rename
  • Clarify QObject memory management patterns with Qt parenting
  • Recommend thread_utils::parallel_for_each_tl for shortest path relaxation phases
AGENTS.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • In the Coding Guidelines section, consider briefly explaining the criteria for choosing between Signal2 and Qt signals (e.g., performance-critical vs. UI-only, QObject vs. non-QObject contexts) so that contributors have a clearer decision rule rather than just a default preference.
  • The atomic file saving guideline could be strengthened by mentioning typical temp-file usage (e.g., write to a temporary path in the same directory, then rename over the target) to make the intended pattern fully concrete and harder to misapply.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the Coding Guidelines section, consider briefly explaining the criteria for choosing between Signal2 and Qt signals (e.g., performance-critical vs. UI-only, QObject vs. non-QObject contexts) so that contributors have a clearer decision rule rather than just a default preference.
- The atomic file saving guideline could be strengthened by mentioning typical temp-file usage (e.g., write to a temporary path in the same directory, then rename over the target) to make the intended pattern fully concrete and harder to misapply.

## Individual Comments

### Comment 1
<location path="docs/architecture.md" line_range="30" />
<code_context>
+### Map and World State (`src/map/`, `src/mapdata/`)
+*   **MapData**: The primary owner of the map state.
+*   **World**: Represents the game world (rooms, exits, areas).
+*   **SpatialDb**: An R-Tree based database for fast spatial queries (e.g., "what room is at these coordinates?").
+
+### Rendering (`src/display/`, `src/opengl/`)
</code_context>
<issue_to_address>
**nitpick (typo):** Consider standard hyphenation in 'R-Tree based database'.

Suggest using “an R-tree-based database for fast spatial queries” for more standard compound-adjective hyphenation.

```suggestion
*   **SpatialDb**: An R-tree-based database for fast spatial queries (e.g., "what room is at these coordinates?").
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/architecture.md Outdated
- Create docs/architecture.md covering the Proxy pipeline, PathMachine
  states (Approved/Experimenting/Syncing), MapStorage, Rendering,
  and MUD integration systems.
- Update AGENTS.md with a link to the architecture doc and a new
  "Coding Guidelines" section capturing project-specific best practices
  (Signal2, string encoding, atomic saving).
@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.36%. Comparing base (4f57972) to head (5feff77).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #230   +/-   ##
=======================================
  Coverage   25.36%   25.36%           
=======================================
  Files         519      519           
  Lines       43181    43181           
  Branches     4705     4705           
=======================================
  Hits        10952    10952           
  Misses      32229    32229           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

nschimme added 4 commits May 19, 2026 17:23
- Author docs/architecture.md as a high-level technical overview covering
  the Proxy pipeline, PathMachine logic, MapStorage, Rendering, and MUD
  integration systems.
- Include a domain glossary (GMCP, MPI, Vitals) and a "Common Developer
  Tasks" guide in docs/architecture.md.
- Update AGENTS.md to link to architecture.md and BUILD.md.
- Add a "Coding Guidelines" section to AGENTS.md capturing project-
  specific best practices (Signal2, string encoding, atomic saving).
- Add a "Development Tips" section to AGENTS.md with advice on tracing
  data flow and running specific tests.
- Create docs/architecture.md: Detailed technical overview covering the
  proxy pipeline, PathMachine states, MapStorage, rendering/shader
  architecture (FBO, UBO, multisampling), and MUD integration.
- Include a developer task guide and a glossary with a link to MUME's
  GMCP documentation.
- Update AGENTS.md: Orientation, prescriptive coding guidelines
  (Signal2, string encoding, atomic saving), and development tips
  for tracing data flow and testing.
- Ensure cross-linking between BUILD.md, AGENTS.md, and architecture.md
  for a seamless developer experience.
- Create docs/architecture.md: Detailed technical overview covering the
  proxy pipeline, PathMachine states, MapStorage, rendering/shader
  architecture (FBO, UBO, multisampling), and MUD integration.
- Include a developer task guide and a glossary with a link to MUME's
  GMCP documentation and clarified MPI/MUME.Client terminology.
- Update AGENTS.md: Orientation, prescriptive coding guidelines
  (Signal2, string encoding, atomic saving), and development tips.
- Ensure cross-linking between BUILD.md, AGENTS.md, and architecture.md.
- Create docs/architecture.md: Detailed technical overview covering the
  proxy pipeline, PathMachine states, MapStorage, rendering/shader
  architecture (FBO, UBO, multisampling), and MUD integration.
- Include a developer task guide and a glossary with verified
  terminology and a link to MUME's GMCP documentation.
- Update AGENTS.md: Orientation, prescriptive coding guidelines
  (Signal2, string encoding, atomic saving), and development tips.
- Ensure cross-linking between BUILD.md, AGENTS.md, and architecture.md.
@nschimme
nschimme force-pushed the master branch 3 times, most recently from ae664f2 to bcd8fca Compare May 21, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant